<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague League Management and Prediction Game for Joomla!
 * @version $Id: edit_matrix_rounds.tpl.php 1235 2008-07-18 13:04:34Z julienv $
 * @package Joomleague
 * @copyright Copyright (C) 2007  JoomLeague
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see _joomleague_license.txt
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 
$output = <<<EOL
<script language="javascript" type="text/javascript">
function move(fbox, tbox) {
       var arrFbox = new Array();
       var arrTbox = new Array();
       var arrLookup = new Array();
       var i;
       for(i=0; i<tbox.options.length; i++) {
            arrLookup[tbox.options[i].text] = tbox.options[i].value;
            arrTbox[i] = tbox.options[i].text;
       }
       var fLength = 0;
       var tLength = arrTbox.length
       for(i=0; i<fbox.options.length; i++) {
            arrLookup[fbox.options[i].text] = fbox.options[i].value;
            if(fbox.options[i].selected && fbox.options[i].value != "") {
                 arrTbox[tLength] = fbox.options[i].text;
                 tLength++;
            } else {
                 arrFbox[fLength] = fbox.options[i].text;
                 fLength++;
            }
       }
       fbox.length = 0;
       tbox.length = 0;
       var c;
       for(c=0; c<arrFbox.length; c++) {
            var no = new Option();
            no.value = arrLookup[arrFbox[c]];
            no.text = arrFbox[c];
            fbox[c] = no;
       }
       for(c=0; c<arrTbox.length; c++) {
       	var no = new Option();
       	no.value = arrLookup[arrTbox[c]];
       	no.text = arrTbox[c];
       	tbox[c] = no;
       }
  }
  function selectAll(box) {
  
    for(var i=0; i<box.length; i++) {
      box[i].selected = true;
    }
  }  

var http_request = false;
var bustcachevar=0; //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects="";
var rootdomain="http://"+window.location.hostname;
var bustcacheparameter="";

function ajaxpage(matchid, cidnummer){

var getpage=false;
var containerid = "details" + matchid;

var cidid = "cb"+cidnummer;
if (document.getElementById(containerid) && document.getElementById(containerid).style.display=='none') {
	document.getElementById(containerid).style.display='block';
	var url="index3.php?option=com_joomleague&act=editmatch&mytask=load&p=$project->id&mid="+matchid;
	document.getElementById(cidid).checked=true;
	isChecked(document.getElementById(cidid));
	getpage=true;
}
else if (document.getElementById(containerid)) {
	
	var url="index3.php?option=com_joomleague&act=editmatch&mytask=cancel&p=$project->id&no_html=1&mid="+matchid;
	var answer = confirm ("Changes wil be lost if you leave now! Are you sure?")
	if (answer) {
		document.getElementById(cidid).checked=false;
		isChecked(document.getElementById(cidid));
		document.getElementById(containerid).innerHTML='a';
		document.getElementById(containerid).style.display='none';
		}
		else {
			document.getElementById(cidid).checked=true;
			return;
		}
}

var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}
function switchMenu(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = 'block';
	}
}
function SaveMatch(a,b,c){
    var f = document.matrixForm;
    if(f){
      f.elements['matchpart1'].value = a;
      f.elements['matchpart2'].value = b;
      f.submit();
    }
  }


   function addmatches () {
   document.getElementById('addmatchescount').value = document.getElementById('tempaddmatchescount').value;
   document.matrixForm.submit();
   }
   function FormSwitch(matchid, action) {
    	if (action == 0) var what=true;
    	if (action == 1) var what=false;
    	var field1='matchpart1_result_decision'+matchid;
    	var field2='matchpart2_result_decision'+matchid;
    	var field3='decision_info'+matchid;
		document.getElementById(field1).disabled=what;
		document.getElementById(field2).disabled=what;
		document.getElementById(field3).disabled=what;
    }
</script>
EOL;
$mainframe->addCustomHeadTag( $output );
//$mainframe->addCustomHeadTag( '<script src="'.JL_URL_FOLDER.'/js/mootools.v1.1.js" type="text/javascript" charset="utf-8"></script>' );

$output = '<style>
             #log_res.ajax-loading {
              padding: 20px 0;
              background: url(';
$output .= JL_URL_FOLDER.'/frontend/default/images/spinner.gif) no-repeat center;}
             </style>';

$mainframe->addCustomHeadTag( $output );
$mainframe->addCustomHeadTag( '<script src="'. JL_URL_FOLDER.'/js/JL_eventsediting.js" type="text/javascript"></script>' );
?>
<div style="display:none"><form name="empty"><?php editorArea( 'editor1',  'bla' , 'irgendwas', '98%', '200', '50', '5' );?></form>
</div>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo _JOOMLA_JL_LIVE_SITE;?>/includes/js/calendar/calendar-mos.css" title="green" />
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;">
</div>

<!-- import the calendar script -->
<script language="javascript" type="text/javascript" src="<?php echo _JOOMLA_JL_LIVE_SITE;?>/includes/js/calendar/calendar_mini.js"></script>

<!-- import the language module -->
<script language="javascript" type="text/javascript" src="<?php echo _JOOMLA_JL_LIVE_SITE;?>/includes/js/calendar/lang/calendar-en.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo _JOOMLA_JL_LIVE_SITE;?>/includes/js/overlib_mini.js"></script>

<div id="right">
	<div id="rightpad">
    <!-- Header START -->	
		<div id="step">
			<div class="t">
        <div class="t">
          <div class="t"></div>
        </div>
      </div>
      <div class="m" align="left">
				<div class="far-right">
							<div class="button1-left"><div class="help"><a href="http://www.joomleague.de" title="<?php echo _JL_ADMIN_MANUAL;?>" target="blank"><?php echo _JL_ADMIN_MANUAL;?></a></div></div>
							<div class="button1-left"><div class="forum"><a href="http://www.joomleague.de/forum/" title="<?php echo _JL_ADMIN_FORUM;?>" target="blank"><?php echo _JL_ADMIN_FORUM;?></a></div></div>
							<div class="button1-left"><div class="about"><a href="http://www.joomleague.de" title="<?php echo _JL_ADMIN_INFO;?>" target="blank"><?php echo _JL_ADMIN_INFO;?></a></div></div>
				</div>
				<div class="button1-left"><div class="blank"><a href="index2.php?option=com_joomleague"></a></div></div><span class="step"><?php echo $project->name;?>&nbsp;-&nbsp;<?php echo $selected_round->name;?></span>
			</div>
      <div class="b">
        <div class="b">
          <div class="b"></div>
        </div>
      </div>
    </div>
    <!-- Header END --> 

    <!-- Special Menu START (Mass add)--> 
    <div id="specialmenu" style="display:none;width:auto;">
			<div id="step">
			<div class="t">
        <div class="t">
          <div class="t"></div>
        </div>
      </div>
      <div class="m" align="left">
			  <table>
				  <tr>
					  <td width="230"><img src="images/new_f2.png" border="0" hspace="10" align="left"/>
					  ADD <input type="text" name="tempaddmatchescount" id="tempaddmatchescount" value="1" size="3" class="inputbox" />
					  <a href="javascript:void(0)" onclick="addmatches()"> NEW MATCH(ES)</a>
					  </td>
            <td valign="top" width="110"><b>Copy matches from:</b></td>
            <td valign="top" width="55%" align="left">
              <form name="copyform" action="index2.php" method="post" style="display:inline">
							<input type="hidden" name="id" value="<?php echo $selected_round->id; ?>" />
							<input type="hidden" name="act" value="rounds" />
							<input type="hidden" name="option" value="<?php echo JL_OPTION;?>" />
							<input type="hidden" name="project_id" value="<?php echo $project->id;?>" />  
							<input type="hidden" name="task" value="copyfrom" />
              <?php echo $copy_round_list;?> 
							Default Match Date/Time: <input type="text" name="date" class="inputbox" size="13" maxlength="11" value="<?php echo $selected_round->round_date_first; ?>" />
							<input type="text" name="time" value="12:00" size="5" maxlength="8" class="inputbox" /><br />
							 First Match Number: <input type="text" name="start_match_number" size="3" value="" /> 
                <acronym title="If you don't create new matches all your actual matches this round are overwritten with matches from selected source round">
                Create new?
                </acronym> 
              <input type="checkbox" name="create_new" value="1" class="inputbox" checked="checked" />
              <select name="mirror" class="inputbox">
							  <option value="0" selected="selected">Copy</option>
							  <option value="1">Mirror</option>
							</select> <input type="submit" value="Los" />
						  </form>
						</td>
				 </tr>
				</table>
      </div>
      <div class="b">
        <div class="b">
          <div class="b"></div>
        </div>
      </div>
      </div> <!-- step -->
    </div> <!-- special menu -->
	  <!-- Special Menu END -->
	  
	  <!-- Main info -->
	  <div id="installer">
	    <div class="t">
	      <div class="t">
	        <div class="t"></div>
	      </div>
	    </div>  
	    
	    <div class="m" align="left">
	    
	      <!-- Title START -->
	      <h2><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_TITLE;?></h2> 
			  <!-- Titel END -->
			  
		    <!-- Hint 1 START -->
				<div id="step">
					<div class="t">
		        <div class="t">
		          <div class="t"></div>
		        </div>
		      </div>
		      <div class="m" align="left">
						<table class="content" cellpadding="4">
						 <tr>
						  <td><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_HINT1;?> 
						  </td>
						 </tr>
						</table>
					</div>
		      <div class="b">
		        <div class="b">
		          <div class="b"></div>
		        </div>
		      </div>
		    </div>
		    <!-- Hint 1 END -->
				<!-- round selector START -->
				<div align="right">
			  	<form name="roundForm" action="index2.php" method="post">
					<input type="hidden" name="act" value="rounds" />
					<input type="hidden" name="option" value="<?php echo JL_OPTION;?>" />
					<input type="hidden" name="project_id" value="<?php echo $project->id;?>" />  
					<input type="hidden" name="task" value="<?php echo $tab;?>" />
			  	<?php echo $round_list;?>
	  		  </form>
	  		</div>
		    <!-- round selector END -->
<?php
 if ((isset($overall_config['use_jl_substitution']) && $overall_config['use_jl_substitution']) || (isset($overall_config['use_jl_events']) && $overall_config['use_jl_events'])) { ?>
		    <!-- game selector START -->
	        <div align="right">
	        <b>
            <?php          $RosterEventMessage = (isset($overall_config['use_jl_substitution']) && $overall_config['use_jl_substitution']) ? _JL_STARTING_ROSTERS : '';
          if (isset($overall_config['use_jl_events']) && $overall_config['use_jl_events']) {
            if (isset($overall_config['use_jl_events']) && $overall_config['use_jl_substitution']) $RosterEventMessage .= ' / ';
            $RosterEventMessage .= _JL_ADMIN_EDIT_LIST_MATCHES_EVENTS;
          }
          $RosterEventMessage .= ($RosterEventMessage != '') ? ':</b> ' : '';
          echo $RosterEventMessage.mosHTML::selectList( $mdd, 'mdd', 'id="mdd" class="inputbox" onchange="jl_load_new_match_events(this, \'eventscontainer\')"','value', 'text', '0' );?>
					</div>
	      <!-- game selector END -->
<?php
 }
?>
		      
		    <div id="log_res"></div>
		    <div id="eventscontainer"></div>
		    
		    <!-- Games list START -->
        <div class="install-text2">
			    <form action="index2.php" method="post" name="adminForm">
					  <table cellpadding="4" cellspacing="0" border="0" class="adminlist2">
              <thead>
					    <tr>
				        <th width="20">
				  			  <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $matches ); ?>);" />
				  		  </th>
				  		  <th width="20" align="center">&nbsp;</th>
								<th width="20" nowrap="nowrap" align="center"><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_ID;?></th>
			          <?php if ($config['show_match_number']==1) { ?>
							  <th nowrap="nowrap" align="center"><?php echo "NR";?></th>
			          <?php } ?>
								<th nowrap="nowrap" align="center"><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_DATE;?></th>
								<th nowrap="nowrap" align="center"><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_TIME;?></th>
				        <th width="30%" nowrap="nowrap" align="right"><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_HOME;?></th>
				        <th width="5">&nbsp;</th>
				        <th width="30%" nowrap="nowrap" align="left"><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_AWAY;?></th>
				        <th nowrap="nowrap" align="center"><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_RESULT;?></th>
			          <?php if($project->allow_add_time){?><th align="center"><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_TYPE;?></th><?php } ?>
			          <th nowrap="nowrap" align="center"><?php echo _JL_ADMIN_PUBLISHED_SHORT;?></th>
					    </tr>
					    </thead>
					    <tbody>
			
			  <?php 
			    // generate teams dropdown
			    $teams = $project->getTeams();
					$teamsoptions[] = mosHTML::makeOption(0,_JL_CHOOSE_TEAM);
					foreach ($teams AS $team) {
					  $teamsoptions[] = mosHTML::makeOption($team->id, $team->name);
					}
					
					$k = 0;
					$colspan=($project->allow_add_time)?12:11;
					$colspan += ($config['show_match_number']==1) ? 1 : 0;
					
					for ($i=0, $n=count( $matches ); $i < $n; $i++) {
					  $inputappend='';
						$match = new Match ($database);
						$match->bind( get_object_vars($matches[$i]) );
						$match->id = $match->match_id;
						
						if ($match->checked_out) {
						  $query="SELECT username FROM #__users WHERE id = ".$match->checked_out;
						  $database->setQuery($query);
						  $match->editor = $database->loadResult();
						}
						else $match->editor = '';
						
			      mosMakeHtmlSafe($match);
			      $link = JL_ADMIN_COMPONENT_LINK.'&act=players&task=edit&cid[]='. $match->id;
			      $checked = mosCommonHTML::CheckedOutProcessing( $match, $i );
			      $datumzeit = $match->match_date;
			    	list($datum, $uhrzeit)=split(" ", $datumzeit);   
			    	$uhrzeit = strftime ("%H:%M", strtotime($uhrzeit));   
			      $mstl = '&nbsp;';
			      if($project->allow_add_time){
			        $mstl = HTML_joomleague::getResultTypeSelect("match_result_type".$match->match_id, 'class="inputbox" size="1"', $match->match_result_type);
			      }
			  ?>
						<tr class="row<?php echo $k; ?>">
			        <td width="20">
			        <?php echo $checked; ?>
							</td>
							<td align="center" width="20">
				        <?php		
				        if ( $match->checked_out && ($match->checked_out == $my->id 
				               || strtolower($my->usertype) == 'super administrator') ) { ?>
								  <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" 
								         value="<?php echo $match->id;?>" style="display:none" /><?php   
				        }
				        else if ($match->checked_out) $inputappend=' disabled="disabled"';
				        
				        if (!$match->checked_out || $match->checked_out == $my->id 
				               || strtolower($my->usertype) == 'super administrator') {?>
									<a href="javascript:void(0)" 
									   onclick="tinyMCE.execCommand('mceRemoveControl', true, 'summary<?php	echo $match->match_id;?>');
									            tinyMCE.triggerSave();
									            ajaxpage('<?php echo $match->match_id;?>', '<?php echo $i;?>');" 
									            title="<?php echo _JL_EDIT_DETAILS;?>">
						    	  <img src="<?php echo _JOOMLA_JL_LIVE_SITE;?>/components/com_joomleague/frontend/<?php echo $project->template;?>/images/edit.png" 
						    	       border="0" 
						    	       alt="<?php	echo _JL_EDIT_DETAILS;?>" title="<?php echo _JL_EDIT_DETAILS;?>"/>
					    	  </a><?php   
				        }
				        ?>
			        </td>
							<td align="center" width="20"><?php echo $match->match_id;?></td>
								<?php 
								if ($config['show_match_number']==1) { ?>
									<td>
									  <input <?php echo $inputappend;?> 
									         type="text" class="inputbox" 
									         name="match_number<?php echo $match->match_id;?>" 
									         value="<?php	echo $match->match_number;?>" 
									         size="3" onchange="javascript:document.adminForm.cb<?php echo $i;?>.checked = true; isChecked(this.checked);" />
									</td><?php 
				        } 
				        ?>
							<td nowrap="nowrap">
				        <input <?php echo $inputappend;?> type="text" name="match_date<?php echo $match->match_id;?>" 
				               id="match_date<?php echo $match->match_id; ?>" 
				               value="<?php echo $datum;?>" size="9" class="inputbox" 
				               onchange="javascript:document.adminForm.cb<?php echo $i;?>.checked = true; isChecked(this.checked);" />
				        <input<?php echo $inputappend;?> type="reset" style="font-size:9px;" 
				           class="inputbox" value="..." 
				           onclick="return showCalendar('match_date<?php echo $match->match_id;?>', 'y-mm-dd');" />
							</td>
							<td align="center" nowrap="nowrap">
								<input <?php echo $inputappend;?> type="text" name="match_time<?php echo $match->match_id;?>" 
								       value="<?php	echo $uhrzeit;?>" size="4" class="inputbox" 
								       onchange="javascript:document.adminForm.cb<?php echo $i;?>.checked = true; isChecked(this.checked);" />
							</td>
			        <td nowrap="nowrap" align="right">
				        <?php	
				        echo mosHTML::selectList( $teamsoptions, 
				                       "matchpart1$match->match_id", 
				                       'class="inputbox"'.$inputappend.' style="font-size:9px;" onchange="document.adminForm.cb'.$i.'.checked = true; isChecked(this.checked);"size="1"',
				                       'value', 'text', $match->matchpart1 );
				        ?>
				      </td>
			        <td width="5">-</td>
			        <td nowrap="nowrap" align="left">
			          <?php	
			          echo mosHTML::selectList( $teamsoptions, 
			                "matchpart2$match->match_id", 
			                'class="inputbox"'.$inputappend.' style="font-size:9px;" onchange="document.adminForm.cb'.$i.'.checked = true; isChecked(this.checked);" size="1"',
			                'value', 'text', $match->matchpart2 );
			          ?>
			        </td>
			        <td nowrap="nowrap" align="right">
					    	<input <?php echo $inputappend;?> type="text" name="matchpart1_result<?php echo $match->match_id;?>" 
					    	       value="<?php	echo $match->matchpart1_result;?>" size="2" tabindex="1" 
					    	       class="inputbox" 
					    	       onchange="javascript:document.adminForm.cb<?php echo $i;?>.checked = true; isChecked(this.checked);" />
			          :
				    	  <input <?php echo $inputappend;?> type="text" name="matchpart2_result<?php echo $match->match_id;?>" 
				    	        value="<?php echo $match->matchpart2_result;?>" size="2" tabindex="1" 
				    	        class="inputbox" 
				    	        onchange="javascript:document.adminForm.cb<?php echo $i;?>.checked = true; isChecked(this.checked);" />
				      	<?php
								$match->editPart_results ($i, $project, 1);
								?>
							</td>
			        <?php	
						  if($project->allow_add_time){ echo '<td align="center">'.$mstl.'</td>'; }
						  $task = $match->published ? 'unpublishmatches' : 'publishmatches';
						  $img = $match->published ? 'tick.png' : 'publish_x.png';
			        ?>
			      <td align="center">
				      <?php 
				      if (!$match->checked_out || $match->checked_out == $my->id) {?>
				        <a href="javascript: void(0);" 
				           onclick="return listItemTask('cb<?php echo $i;?>','<?php echo $task;?>')"><?php 
							}
							?>
				      <img src="images/<?php echo $img;?>" width="12" height="12" border="0" alt="" />
							<?php if (!$match->checked_out || $match->checked_out == $my->id) {?>
							  </a><?php 
			        }?>
			      </td>
			     </tr>
			     <tr>
			       <td align="center" colspan="<?php echo $colspan;?>" style="height:auto">
			    	   <div id="details<?php echo $match->match_id;?>" style="display:none"></div>
			    	 </td>
			     </tr>
			    <?php
			    $k = 1 - $k; 
			    } ?>
			      </tbody>
					  </table>
					<input type="hidden" name="id" value="<?php echo $selected_round->id; ?>" />
					<input type="hidden" name="act" value="rounds" />
					<input type="hidden" name="option" value="<?php echo JL_OPTION;?>" />
					<input type="hidden" name="project_id" value="<?php echo $project->id;?>" />  
					<input type="hidden" name="task" value="<?php echo $tab;?>" />
					<input type="hidden" name="boxchecked" value="0" />
					<input type="hidden" name="round" value="<?php echo $selected_round->id; ?>" />
				</form>
        </div>
	      <!-- Game LIST END -->
	      <br />
	      
				<div class="newsection"></div>
				
				<!-- Matrix start -->
				<form action="index2.php" method="post" name="matrixForm" id="matrixForm">
				<?php
				if (count($teams) <= 20) { ?>
					<!-- Title 2 START -->      
					<h2><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_TITLE2;?></h2>
				  <!-- Title 2 END -->
				  <!-- Hint 2 START -->   			
						<div id="step">
							<div class="t">
				        <div class="t">
				          <div class="t"></div>
				        </div>
				      </div>
				      <div class="m" align="left">
								<table class="content" cellpadding="4">
								 <tr>
								  <td><?php echo _JL_ADMIN_EDIT_MATRIX_ROUNDS_HINT2;?></td>
								 </tr>
								</table>
							</div>
				      <div class="b">
				        <div class="b">
				          <div class="b"></div>
				        </div>
				      </div>
				    </div>
				  <!-- Hint 2 END -->
	
					<!-- Content 2 START -->				
					<?php echo $matrix; ?>
					<!-- Content 2 END -->	
				<?php 
				}?>
				<input type="hidden" name="act" value="rounds" />
				<input type="hidden" name="option" value="com_joomleague" />
				<input type="hidden" name="matchpart1" value="" />
				<input type="hidden" name="matchpart2" value="" />
				<input type="hidden" name="round" value="<?php echo $selected_round->id; ?>" />
				<input type="hidden" name="round_id" value="<?php echo $selected_round->id; ?>" />
				<input type="hidden" name="project_id" value="<?php echo $project->id;?>" />  
				<input type="hidden" name="func" value="savematch" />
				<input type="hidden" name="task" value="tab1" />
				<input type="hidden" name="boxchecked" value="0" />
				<input type="hidden" name="match_date" value="<?php echo $selected_round->round_date_first. " 12:00:00"; ?>" />
				<input type="hidden" name="add_match_count" id="addmatchescount" value="1" />
				</form>
	    </div> <!-- m -->  
			
			<div class="b">
			  <div class="b">
			    <div class="b"></div>
			  </div>
			</div>
      
    </div><!-- installer -->
  </div> <!-- rightpad -->
</div> <!-- right -->  
<div class="clr"></div>
